<template>
  <div style="cursor:pointer">
    <svg v-if="props.show" t="1660299003389" class="icon" viewBox="0 0 1024 1024" version="1.1"
      xmlns="http://www.w3.org/2000/svg" p-id="1717" width="24" height="24">
      <path
        d="M171.033298 85.391661c0-47.095401 38.19627-85.391661 85.29167-85.391661h511.950005c47.095401 0 85.291671 38.19627 85.291671 85.391661v853.216678c0 47.095401-38.19627 85.391661-85.291671 85.391661h-511.950005c-47.095401 0-85.291671-38.19627-85.29167-85.391661V85.391661z"
        fill="#666666" p-id="1718"></path>
      <path
        d="M213.729128 85.391661c0-23.597696 19.098135-42.69583 42.695831-42.695831h511.950004c23.597696 0 42.69583 19.098135 42.695831 42.695831v853.216678c0 23.597696-19.098135 42.69583-42.695831 42.695831h-511.950004c-23.597696 0-42.69583-19.098135-42.695831-42.695831V85.391661z"
        fill="#FEFCEA" p-id="1719"></path>
      <path d="M213.729128 127.987501H810.970804v725.229177H213.729128z" fill="#C1E19D" p-id="1720"></path>
      <path
        d="M427.0083 917.210429c0-11.798848 9.499072-21.29792 21.39791-21.29792h127.987502c11.798848 0 21.39791 9.599063 21.39791 21.29792 0 11.798848-9.499072 21.29792-21.39791 21.29792h-127.987502c-11.798848 0.09999-21.39791-9.499072-21.39791-21.29792z"
        fill="#666666" p-id="1721"></path>
    </svg>
    <svg v-else t="1660299214685" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
      p-id="1874" width="24" height="24">
      <path
        d="M384 959.7v-85.3H85.4c-47.1 0-85.4-38.2-85.4-85.3V106.3c0-47.1 38.2-85.3 85.4-85.3h853.3c47.1 0 85.4 38.2 85.4 85.3V789c0 47.1-38.2 85.3-85.4 85.3H640v85.3h106.7c11.8 0 21.3 9.6 21.3 21.3 0 11.8-9.5 21.3-21.3 21.3H277.3c-11.8 0-21.3-9.6-21.3-21.3 0-11.8 9.5-21.3 21.3-21.3H384v0.1z"
        fill="#666666" p-id="1875"></path>
      <path d="M85.4 63.7h853.3c23.6 0 42.7 19.1 42.7 42.7v597.3H42.7V106.3c0-23.5 19.1-42.6 42.7-42.6z" fill="#E8F3FF"
        p-id="1876"></path>
      <path d="M128 149h768v469.3H128z" fill="#FFBDA7" p-id="1877"></path>
    </svg>
  </div>
</template>

<script setup>
// // 接收父组件的props，:show="true",显示手机图标，:show="false",显示电脑图标
// let props = defineProps({
//   show: {
//     type: Boolean,
//     required: true,
//     default: false
//   },
// })

let props = { show: false }
// 判断当前设备
function currentDevice() {
  // 判断手机还是电脑
  if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
    props.show = true
    console.log("手机用户"); //手机
  } else {
    props.show = false
    console.log("电脑用户"); //电脑
  }
}
currentDevice()

</script>

<style scoped>
</style>